<%@ include file="/taglibs.jsp"%>
<head>
	<title><fmt:message key="listReceivedFileForm.title"/></title>
</head>

<s:form name="listReceivedFilesByDateForm" action="exportListReceivedFiles" method="post" validate="true">
	<s:select key="reportByDepartment.form.department" name="deptId" list="lstDepartment" listKey="id" listValue="name"></s:select>
	<table class="table">
		<tr>
			<td>
		        <s:property value="getText('report.fromdate')"/>
		    </td>
		    <td>
		        <s:textfield id="fromDate" readonly="true" name="fromDate" size="15" theme="simple" required="true"/>
		    </td>
			<td>
		        <s:property value="getText('report.todate')"/>
		    </td>
		    <td>
		        <s:textfield id="toDate" name="toDate" readonly="true" size="15" theme="simple" required="true"/>
		    </td>     
		</tr>
		<tr>
			<td colspan="4">
				<button type="submit" onclick="this.blur()" class="button" name="search">
					<fmt:message key="button.execute.title"></fmt:message>
					<img src="${ctx}/images/page_white_word.png" align="left" height="20" width="20">
				</button></td>
		</tr>
   </table>
</s:form>

<script type="text/javascript">//<![CDATA[
		
	$(document).ready(function (){
		var currentTime = new Date();
		var month = currentTime.getMonth() + 1;
		var day = currentTime.getDate();
		if(month < 10) month = "0" + month;
		if(day < 10) day = "0" + day;
		var year = currentTime.getFullYear();
		var hours = currentTime.getHours();
		var minute = currentTime.getMinutes();
		
		var startTime = day + "/" + month + "/" + year + " 08:00";
		var endTime = day + "/" + month + "/" + year + " " + hours + ":" + minute;

	  	$("#fromDate").val(startTime);
	  	$("#toDate").val(endTime);
	});
	
	dDate=Date(); 
	var cal = Calendar.setup({ 
		onSelect: function(cal) { cal.hide();},
		showTime: true, 
		weekNumbers: false,  
		date: dDate
		});
	
	cal.manageFields("fromDate","fromDate","%d/%m/%Y %H:%M");
    cal.manageFields("toDate","toDate","%d/%m/%Y %H:%M");
</SCRIPT>